import type { RouteRecordRaw } from 'vue-router';
import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    meta: {
      icon: 'ic:baseline-settings',
      keepAlive: true,
      order: 900,
      title: $t('system.title'),
    },
    name: 'System',
    path: '/system',
    children: [
      {
        path: '/system/user',
        name: 'SystemUser',
        meta: {
          icon: 'mdi:account',
          title: $t('system.user.title'),
        },
        component: () => import('#/views/system/user/list.vue'),
      },
      {
        path: '/system/role',
        name: 'SystemRole',
        meta: {
          icon: 'mdi:account-group',
          title: $t('system.role.title'),
        },
        component: () => import('#/views/system/role/list.vue'),
      },
      {
        path: '/system/menu',
        name: 'SystemMenu',
        meta: {
          icon: 'mdi:menu',
          title: $t('system.menu.title'),
        },
        component: () => import('#/views/system/menu/list.vue'),
      },
      {
        path: '/system/dept',
        name: 'SystemDept',
        meta: {
          icon: 'charm:organisation',
          title: $t('system.dept.title'),
        },
        component: () => import('#/views/system/dept/list.vue'),
      },
      {
        meta: {
          title: $t('log.title'),
          icon: 'ic:baseline-assignment',
        },
        name: 'SystemLog',
        path: 'log',
        children: [
          {
            meta: {
              title: $t('log.login.title'),
              roles: ['admin'],
            },
            name: 'SystemLoginLog',
            path: 'login',
            component: () => import('#/views/system/sys-logs/login-log.vue'),
          },
          {
            meta: {
              title: $t('log.exception.title'),
              roles: ['admin'],
            },
            name: 'SystemExceptionLog',
            path: 'exception',
            component: () => import('#/views/system/sys-logs/exception-log/index.vue'),
          }
        ]
      }
    ],
  },
];

export default routes;
